//构造函数   constructor
function Person(name,age){
    //new的方式来调用的话
    console.log(this)
    this.name = name;
    this.age = age;
}
Person.prototype.sayHi = function (){
    console.log('hello');
}
Person.prototype.playBasketball = function(){
    console.log('打篮球');
}

//new 来调用
const wf = new Person('王飞',18);
console.log(wf.name);
wf.sayHi()